<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    <link href="${ctx.resource}/css/credit-mall.css" rel="stylesheet">
    <title>修改地址</title>
  </head>
  <body>
    <div class="page-group">
      <div class="page page-current">
        <form>
          <div class="list-block no-margin address-info">
            <ul>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title label">收货人</div>
                  <div class="item-input">
                  	<input type="hidden" name="id" value="${userAddress.id }">
                    <input type="text" placeholder="姓名" name="contactName" value="${userAddress.contactName }">
                    <span class="iconfont icon-tongxunlu"></span>
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title label">手机号码</div>
                  <div class="item-input">
                    <input type="text" placeholder="11位手机号码" name="contactPhone" value="${userAddress.contactPhone }">
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title label">地区信息</div>
                  <div class="item-input">
                    <input type="text" placeholder="地区信息" id="city-picker" value="${userAddress.province } ${userAddress.city} ${userAddress.region}">
                   <!--  <span class="iconfont icon-dingwei"></span> -->
                    <input type="hidden" name="province" value="${userAddress.province }">
                    <input type="hidden" name="city" value="${userAddress.city }">
                    <input type="hidden" name="region" value="${userAddress.region }">
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title label">详细地址</div>
                  <div class="item-input">
                    <textarea placeholder="街道门牌信息" name="address">${userAddress.address}</textarea>
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title label">邮政编码</div>
                  <div class="item-input">
                    <input type="text" placeholder="邮政编码" name="zipCode" value="${userAddress.zipCode }">
                  </div>
                </div>
              </li>
              	<li class="item-content">
                <div class="item-inner">
                  <div class="item-title label">默认地址</div>
                  <div class="item-input">
                    <label class="label-switch">
                      <input type="checkbox" name="defaultAddress" ${userAddress.defaultAddress ? "checked":"" }>
                      <div class="checkbox"></div>
                    </label>
                  </div>
                </div>
              </li>
            </ul>
          </div>
          <div class="submit-button-wrap">
            <a href="javascript:void(0);" class="button save-address-button enabled">保存</a>
          </div>
        </form>
      </div>
    </div>
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/profile/address/profile-address-edit.js" />
    <script type="text/javascript">
      require(['page/profile/address/profile-address-edit'], function(page) {
        page.init({
        	"addressType":"${addressType}",
          "productId": '${creditProductId}',
          "addressId": '${userAddress.id}'
        })
      })
    </script>
  </body>
</html>